<!-- add tab dialog -->
<div id="addTab" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Add a new tab</h3>
  </div>
  <form style="margin:0;padding:0;" action="/page/add" method="POST">
    <?php echo Form::token(); ?>
    <div class="modal-body">

      <label>Tab name</label>
      <input type="text" autocomplete="off" name="name" placeholder="New tab name">
    </div>
    <div class="modal-footer">
      <a href="#" class="btn" data-dismiss="modal">Close</a>
      <input type="submit" name="submit" class="btn btn-primary" value="Save new tab" />
    </div>
  </form>
</div>

<!-- add block dialog -->
<div id="addBlock" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Add a new block to current tab</h3>
  </div>
  <form style="margin:0;padding:0;" action="/block/add" method="POST">
    <?php echo Form::token(); ?>
    <div class="modal-body">

      <label>Block name</label>
      <input type="text" autocomplete="off" name="name" placeholder="New block name">

    </div>
    <div class="modal-footer">
      <a href="#" class="btn" data-dismiss="modal">Close</a>
      <input type="hidden" name="page_id" id="new_block_page_id" value="" />
      <input type="submit" name="submit" class="btn btn-primary" value="Save new block" />
    </div>
  </form>
</div>

<!-- add link dialog -->
<div id="addLink" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Add a new link to a block</h3>
  </div>
  <form style="margin:0;padding:0;" action="/link/add" method="POST">
    <?php echo Form::token(); ?>
    <div class="modal-body">

      <label>Block</label>
      <select id="block_id_select" name="block_id"></select>

      <label>Link name</label>
      <input type="text" autocomplete="off" name="name" placeholder="Link name">

      <label>Link url</label>
      <input type="text" autocomplete="off" name="url" placeholder="http://">

    </div>
    <div class="modal-footer">
      <a href="#" data-dismiss="modal"  class="btn">Close</a>
      <input type="hidden" name="page_id" value="" />
      <input type="submit" name="submit" class="btn btn-primary" value="Save new link" />
    </div>
  </form>
</div>

<!-- generic delete object dialog -->
<div id="deleteObject" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Delete</h3>
  </div>
  <form style="margin:0;padding:0;" action="/XXX/delete" method="POST">
    <?php echo Form::token(); ?>
    <div class="modal-body">
      <p>
        Are you sure you want to delete <span id="object_type"></span> <span id="object_name"></span>?
      </p>
    </div>
    <div class="modal-footer">
      <a href="#" data-dismiss="modal"  class="btn">Never mind</a>
      <input type="hidden" name="id" value="" />
      <input type="submit" name="submit" class="btn btn-danger" value="Yes, delete it." />
    </div>
  </form>
</div>

<!-- generic delete object dialog -->
<div id="editObject" class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Edit</h3>
  </div>
  <form style="margin:0;padding:0;" action="/XXX/edit" method="POST">
    <?php echo Form::token(); ?>
    <div class="modal-body">
      <p>
        You can edit the following fields.
      </p>
      <p>
        Title: <input autocomplete="off" type="text" name="title" value="" />
      </p>
      <p id="edit_url">
        URL: <input autocomplete="off" type="text" name="url" value="" />
      </p>
      <p id="edit_block_id">
        Block: <select name="block_id">

        </select>
      </p>
    </div>
    <div class="modal-footer">
      <a href="#" data-dismiss="modal"  class="btn">Never mind</a>
      <input type="hidden" name="id" value="" />
      <input type="submit" name="submit" class="btn btn-primary" value="Edit" />
    </div>
  </form>
</div>